import axios from '@/utils/request'

const ApiUrl = '/admin_api/order'

/**
 * @description: 获取订单列表
 * @param {*} params
 * @return {*}
 */
export function getList(params) {
  return axios.get(`${ApiUrl}/orders/`, {
    params
  })
}

/**
 * @description: 导出订单
 * @param {*} params
 * @return {*}
 */
export function exportOrders(params) {
  return axios.get(`${ApiUrl}/orders/export/`, { params })
}

/**
 * @description: 全部退款
 * @return {*}
 */
export function allRefund(data) {
  return axios.post(`${ApiUrl}/all_refund/`, data)
}

/**
 * @description: 订单手动不退款归还
 * @return {*}
 */
export function onlyReturn(data) {
  return axios.post(`${ApiUrl}/only_return/`, data)
}

/**
 * @description: 订单手动正常归还
 * @return {*}
 */
export function normalReturn(data) {
  return axios.post(`${ApiUrl}/normal_return/`, data)
}

/**
 * @description: 订单手动选择时间退款
 * @return {*}
 */
export function manualRefund(data) {
  return axios.post(`${ApiUrl}/manual_refund/`, data)
}

/**
 * @description: 订单手动选择时间计算收费金额
 * @return {*}
 */
export function manualUseAmount(data) {
  return axios.post(`${ApiUrl}/manual_use_amount/`, data)
}

/**
 * @description: 订单手动退款时间段（按时间段）
 * @return {*}
 */

export function getManualTimeSlots(params) {
  return axios.get(`${ApiUrl}/manual_time_slots/`, { params })
}

/**
 * @description: 订单退款信息
 * @return {*}
 */
export function getRefundInfo(params) {
  return axios.get(`${ApiUrl}/refund_info/`, { params })
}
